# -*- coding: utf-8 -*-
"""
@Time ： 2024/4/18 10:15
@Auth ： fcq
@File ：sentiment_label_analysis.py
@IDE ：PyCharm
@Motto：ABC(Always Be Coding)
"""
import json
from collections import Counter

idx2stance = {0: 'con', 1: 'pos', 2: 'neutral'}
idx2senti = {0: 'negative', 1: 'positive', 2: "neutral"}


def statistic_data(data_path):
    with open(data_path, 'r', encoding='utf-8') as f:
        data = json.load(f)
    result = []

    for item in data:
        if item['cross_senti'] == 0:
            print('text: ', item['text'], "\nsentiment mask text",item['sentiment_mask_text'],"\ntopic: ", item['target'], '\nsentiment score: ', idx2senti[item['senti_score']], '\nstance: ', idx2stance[item['label']], '\n')
            result.append((idx2senti[item['senti_score']], idx2stance[item['label']]))
    print(Counter(result))
if __name__ == "__main__":
    statistic_data('../VAST/lda_vast_train_cross_senti_mask.json')